vitest: Fail on console errors and warnings (HMS-10806)#4489
Merged
Conversation
Collaborator
Author
|
/jira-epic HMS-10502 |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4489 +/- ##
==========================================
+ Coverage 76.05% 76.09% +0.04%
==========================================
Files 225 225
Lines 7196 7196
Branches 2660 2660
==========================================
+ Hits 5473 5476 +3
+ Misses 1482 1479 -3
Partials 241 241 see 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Some changes introduce warning and error console logs in the test output. This will make the test run fail when there's any "mess" and the problems can be fixed in place instead of retroactively when the test output becomes unreadable. "Maximum update depth exceeded" warning was silences for now and will be revisited later. There's just new act warning and stuff coming in almost every week.
regexowl
commented
Jun 5, 2026
| }, | ||
| }, | ||
| }), | ||
| getUser: () => |
Collaborator
Author
There was a problem hiding this comment.
This is needed to resolve an error that creeped in while deprecating the old wizard.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The global console.error/warn spies in beforeAll/afterAll affect the entire test run; consider scoping them to beforeEach/afterEach or a helper so suites that legitimately assert on console output can opt-in instead of being forced into this behavior.
- The getUser mock now uses setTimeout(…, 0), which introduces an extra macro-task delay and may make tests more brittle; if you only need asynchronous semantics, using Promise.resolve or queueMicrotask would be simpler and less timing-dependent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The global console.error/warn spies in beforeAll/afterAll affect the entire test run; consider scoping them to beforeEach/afterEach or a helper so suites that legitimately assert on console output can opt-in instead of being forced into this behavior.
- The getUser mock now uses setTimeout(…, 0), which introduces an extra macro-task delay and may make tests more brittle; if you only need asynchronous semantics, using Promise.resolve or queueMicrotask would be simpler and less timing-dependent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some changes introduce warning and error console logs in the test output. This will make the test run fail when there's any "mess" and the problems can be fixed in place instead of retroactively when the test output becomes unreadable.
"Maximum update depth exceeded" warning was silences for now and will be revisited later. There's just new act warning and stuff coming in almost every week.
JIRA: HMS-10806